<?php
	include "common.php";
	session_start();
	error_reporting(0);
	if($_SESSION['logInCheck']!=1){
		header('Location: index.php?loginInfo=false');
	}
	$userLink = $_SESSION['userLink'];
	if($userLink!="hrpage.php"){
		echo "Sorry, You have no right to visit this page!!";
		exit;
	}
	$eid = $_SESSION['id'];
	$userFname = $_SESSION['userFname'];
	$userLname = $_SESSION['userLname'];
	$role = $_SESSION['role'];
	
	$userSql = "SELECT * FROM user WHERE e_id = '$eid'";
	$userSqlQuery = mysql_query($userSql);
	$userSqlResult = mysql_fetch_assoc($userSqlQuery);
	
	$email = $userSqlResult['email'];
	$timezone_offset = 6; // for getting local time offset hrs
	$systemDate = gmdate('y-m-d', time()+$timezone_offset*60*60);
	$compToday = strtotime($systemDate);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="index.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="show_report.css" />
<link rel="icon" type="image/ico" href="images/favicon.ico"></link> 
<link rel="shortcut icon" href="images/favicon.ico"></link>
<script src="curvycorners.src.js" type="text/javascript"></script>
<script src="login.js" type="text/javascript"></script>
<title><?php echo "Welcome to ".$userFname." ".$userLname; ?></title>
</head>

<body>
<div class="main_div_other">
	<p><img src="images/creato_logo.jpg" /></p>
    <p id="creatobd">www.creatobd.com</p>
    <p id="date"><script>document.write(new_month+" "+new_date+", "+old_date.getFullYear()+" || "+new_day);</script></p>
    <div class="other_page_icons">
    	<div class="new_notification">
        	<img src="images/arrow_up.JPG" /><p>You have a new notification</p>
        </div><!--end of new_notification-->
    	<ul>
        	<a href="hrpage.php"><li><div id="home"></div><p>home</p><p class="present_class"><img src="images/arrow_up.JPG" /></p></li></a>
            <a href="hr_employee.php"><li><div id="employee"></div><p>employee</p><p class="present_class"><img src="images/arrow_up.JPG" /></p></li></a>
            <a href="hr_onduty.php"><li><div id="onduty"></div><p>on duty</p><p class="present_class"><img src="images/arrow_up.JPG" /></p></li></a>
            <a href="hr_attendance.php"><li><div id="attendance"></div><p>attendance</p><p class="present_class"><img src="images/arrow_up.JPG" /></p></li></a>
            <a href="hr_leave.php"><li><div id="leave"></div><p>leave</p><p class="present_class"><img src="images/arrow_up.JPG" /></p></li></a>
            <a href="hr_notification.php"><li><div id="notification"></div><p>notification</p><p class="present_class"><img src="images/arrow_up.JPG" /></p></li></a>
            <a href="hr_black_box_message.php"><li><div id="blackbox"></div><p>black box</p><p class="present_class"><img src="images/arrow_up.JPG" /></p></li></a>
            <a href="#"><li><div id="hrpolicy"></div><p>hr policy</p><p class="present_class"><img src="images/arrow_up.JPG" /></p></li></a>
            <a href="index.php"><li><div id="logout"></div><p>log out</p><p class="present_class"><img src="images/arrow_up.JPG" /></p></li></a>
        </ul>
    </div><!-- end of other_page_icons-->
    
</div><!-- end of main_div_other-->
<div class="othrpage_1">
    <p>view as: <a href="hr_employee_lists.php">lists</a> | <a href="update_user.php">add</a></p>
</div><!-- end of othrpage_1-->
<div class="human_portal">
  		<p>creato human resourse portal</p>
</div><!-- end of human_portal-->
<div class="page_content">
	<p class="header_page_content"></p>
	<table cellpadding="0" cellspacing="0">
		<tr class="table_header_1"  valign="top">            	                
			<td colspan="7">
				<p>Employee Lists Are Given Below</p>
			</td>
		</tr>
		<tr valign="top" class="table_header_2">
			<td width="60px"><p>ID</p></td>
			<td width="100px;"><p>First Name</p></td>
			<td width="60px;"><p>Last Name</p></td>
			<td width="70px;;"><p>Email</p></td>
			<td width="70px;;"><p>Blood Group</p></td>
			<td width="70px;;" colspan="2"><p>Address</p></td>
		</tr>
		<?php							
			$collectData = "SELECT * FROM user WHERE status = '0'";
			$collectDataQuery = mysql_query($collectData);
			while($collectDataFetchArray = mysql_fetch_array($collectDataQuery)){
				$collectID = $collectDataFetchArray['e_id'];
				$collectFname = $collectDataFetchArray['f_name'];
				$collectLname = $collectDataFetchArray['l_name'];
				$collectmail =$collectDataFetchArray['email'];
				$collectBloodGroup =$collectDataFetchArray['blood_group'];
				$collectAddress =$collectDataFetchArray['address'];
		?>
		<tr valign="top" class="table_header_3">
			<td width="60px"><p><?php echo "<b>".$collectID."</b>"; ?></p></td>
			<td width="100px;"><p><?php echo $collectFname; ?></p></td>
			<td width="60px;"><p><?php echo $collectLname; ?></p></td>
			<td width="60px;"><p><?php echo $collectmail; ?></p></td>
			<td width="60px;"><p><?php echo $collectBloodGroup; ?></p></td>
			<td width="60px;"><p><?php echo $collectAddress; ?></p></td>
			<td width="70px;"><p><a href="hr_employee_report.php?carryId=<?php echo $collectID ?>">Show report</a></p></td>
			<!--<td width="60px;"></td>-->                               
		</tr>
	<?php } ?>
	</table>
         </div><!-- end of page_content -->		
		
</body>
</html>
